<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        function type (obj){
            if (obj === null) {
                return null;
            }else if ( typeof obj === 'object') {
              if (Array.isArray(obj)) {
                  return 'Array';
              }else{
                  return typeof obj;
              }
            }else if (typeof obj === 'number') {
                if (isNaN(obj)) {
                    return NaN;
                }else{
                    return typeof obj;
            }
              
            }else {
               return typeof obj
            }
        }
        let a = {
            say:function(){
                console.log('hello,world');
            }
        }
        const f1 = type2(a.say)
        console.log(f1);


        function type2(obj){
            if (obj === null) {
                return null
            }else if(typeof obj === 'object'){
                if (Array.isArray(obj)) {
                    return 'array'
                }else{
                    return typeof obj
                }
            }else if (typeof obj === 'number'){
                if (isNaN(obj)) {
                    return NaN
                }else{
                    return typeof obj
                }
            }
            else{
                return typeof obj  
            }

            
        }


















    </script>
    
</body>
</html>